<?php

use yii\db\Migration;

class m191231_063159_config extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="系统设置表"';
        $this->createTable('{{%config}}', [
            'id' => $this->primaryKey(),
            'key'=>$this->string()->notNull()->comment('键'),
            'value'=>$this->string()->notNull()->comment('值'),
            'type'=>$this->string()->defaultValue('web')->comment('值'),
            'desc'=>$this->string()->comment('描述'),
            'created_at' => $this->integer()->notNull(),
            'updated_at' => $this->integer()->notNull(),
            'deleted_at' => $this->integer(),
        ],$tableOptions);
//            'site_title' => $this->string()->notNull()->comment('网站标题'),
//            'site_logo' => $this->string()->notNull()->comment('网站logo'),
//            'site_phone' => $this->string()->notNull()->comment('联系电话'),
//            'site_address' => $this->string()->notNull()->comment('联系地址'),
//            'site_record_no' => $this->string()->notNull()->comment('网站备案号'),
//            'site_mail' => $this->string()->notNull()->comment('网站邮箱'),
//            'postcode' => $this->string()->notNull()->comment('邮政编号'),
//            'fax_no' => $this->string()->notNull()->comment('传正电话'),
//            'work_time' => $this->string()->notNull()->comment('工作时间'),
//            'wx_qr_code' => $this->string()->notNull()->comment('微信二维码'),
//            'wb_qr_code' => $this->string()->notNull()->comment('微博二维码'),

    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('{{%config}}');

        return false;
    }
    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
